define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'store.goods/index',
        add_url: 'store.goods/add',
        edit_url: 'store.goods/edit',
        delete_url: 'store.goods/delete',
        export_url: 'store.goods/export',
        modify_url: 'store.goods/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: '主键id'},
                    {field: 'store_name', title: '门店商品名称'},
                    {field: 'store_price', title: '门店商品价格'},
                    {field: 'store_img', minWidth: 80, title: '门店商品图片', search: false, templet: ea.table.image},
                    {field: 'store_volume', title: '门店商品销量'},
                    {field: 'status', title: '门店商品状态', templet: ea.table.switch},
                    {field: 'store_hot', title: '是否热卖', templet: ea.table.switch},
                    {width: 250, title: '操作', templet: ea.table.tool},

                ]],
            });
            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});